﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 策略_工厂
{
    /// <summary>
    /// 策略上下文
    /// </summary>
    internal class StrategyFactory
    {
        /// <summary>
        /// 获取策略对象
        /// </summary>
        /// <param name="role">角色</param>
        /// <returns></returns>
        internal IStrategy GetStrategy(Role role)
        {
            switch (role)
            {
                case Role.Vip: 
                    return new StrategyVip();
                case Role.Common: 
                    return new StrategyCommon();
                default: 
                    return new StrategyCommon();
            }
        }
    }
}
